﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace AppManager.Model
{
    public class BaseModel
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        /// <summary>
        /// order by sort 默认是从小到大，也就是先加的在前面，
        /// 所以默认应该是  OrderByDescending 这样才能后加的出现在前面（一般情况的时候也应该这个样子）
        /// Menu 为了这个符合这个规则的话
        /// </summary>
        public decimal Sort { get; set; } = Convert.ToDecimal(DateTime.Now.ToString("yyyyMMddHHmmss"));        
        public DateTime? CreateDate { get; set; }
        public DateTime UpdateDate { get; set; }

        /// <summary>
        /// 是否可用
        /// </summary>
        public bool Flag { get; set; } = true;
    }

    public class BaseUserModel : BaseModel
    {
        public int CreateUserId { get; set; }
        public int UpdateUserId { get; set; }
    }
}
